package June12;

public class Company {
	String name;
	String adress;
	String Tel;
	String area;

	String[] member = new String[1000];

	// 添加员工信息方法
	public void add(String newMember) {
		for (int i = 0; i < member.length; i++) {
			if (member[i] == null) {
				member[i] = newMember;
				return;
			}
		}
		System.out.println("位置满了");
	}

	public void show() {
		for (int i = 0; i < member.length; i++) {
			if (member[i] == null)
				break;
			System.out.print(member[i] + "\t");
		}
		System.out.println();
	}

	public boolean find(String sname) {
		for (int i = 0; i < member.length; i++) {
			if (member[i] != null && member[i].equals(sname)) {
				return true;
			}
		}
		return false;
	}

	public void delete(String sname) {
		for (int i = 0; i < member.length; i++) {
			if (member[i] != null && member[i].equals(sname)) {
				member[i] = member[i + 1];
			}
			member[member.length - 1] = null;
		}
	}
}
